refactored: layout to be more inheritance based