Refactored Controller