improvements and tweaks

see commit messages