extracting common markup into layout