simplify layout code