refactor my controller