Refactoring full application