refactored application structure