refactor saleorder controller