fixes and clean up