Refactor into controller setup