refacto on controllers