Refactored application into modules