Refactor and waiting for individual commands.