implemented visitor pattern for rendering and initialisation