use statemachine instead of roles