add unitfactory cacheMap, add recursion test.