Refine layout class inheritance with constructor functions