Refactoring and controller updates