Refactoring for rendering a tool ui