Refactor favorites_controller