Move controller method into controller class