more cleanup and design improvements