some code improvements
fixes #5229 - added basic detections for tools