refactored order