Refactored controller to be singleton