Cache constructors in the classes instad of globally.