improvements and fixes