[TASK] Refactor to improve structure and clean up controller