refactors in views and controllers