improve memory usage and implementation of UsersController#view