Refactored order functionality to meet requirements.