refactored application