Refactor the tools checking