this should be in a factory class