Changing factory methods to accept classes for many attributes