further cleanup & fine tuning