Use more function composition in the planning
Merge pull request #2150 from jakub-/planning-refactor

Use more function composition in planning