fixed failing tests, and cleaned up order model