Refactored app to frame and template objects