added some rudimentary cleanup