Refactored app model