fix state machine callback + cleanup some dependencies