Refactoring of order states