Added Tools class,  improved factory stability with thread safe operations