Add restore command. Refactor out parameter expansion.