Move controller specific logic out of model