restructure the app by introducing a concept of controllers