cleanup and reoarganize