generalize layout fct