layout restructuring and fixes