Could these four lines be factored in the base class? It looks like there would be lot of code duplication if one has to write these lines for every new visual.