simplify some content layout code