Cleaning up orders code