Refactoring simulatePlan