bunch of fixes and improvements
bunch of fixes and improvements