Refactored app