Refactoring some code in the workbench.