OCLM-7 Refactored so that lastState is not used anymore