FSM Re-engineering and its Application in Low Power State Encoding