Clean state context and add serializable interface on state machine data