Moved app logic to plan

so that the app only handles input and display