add caching for constructors