Refactored app into controllers