Fixed controller refactoring issues