refactor bids controller