refactored trades_controller