a range of improvements (hope this will be last commit of that sort)