implement command handling and parsing