implement command parser