bunch of improvements, particularly speed