Refactored application layer