Refactored app code.