Implemented and tested the command and state workflow