Refactor orders