Refactor/controller