fix bad code smell in views and controllers