fixes and improvements since last major refactor