added templating with markup inheritance