Merge "Revert "Refactor KeygaurdController using state machine""