Refactored out ordering method