A finite state machine mixin