refactored app