State machine and sequence diagram