Changed order state to a history approach