minor code cleanup and gui layout tweaks