delete conflicting entries
separate out statemachine logic