layout tweaks, code cleanup