Using functions to get the appropriate ui-control for a tool