Move logic to toolbar for setting the target control