refactor cat controller