Refactor execute to take a command string