Refactored Application structure and implementation