refactor controller specs and controller