overall improvements and fixes