Refactor workspace commands.