implement customizable layout

this adds more genericity