major cleanup, automatic layout instead of fixed layout