refacto controller