Added the caching typesmart factory
add caching