Main framework , State Machine, event system