It is strongly inspired by mongoose-statemachine.