refactor order handler