refactors and splits up the orders controller
fixes merge conflict