used factory class for instance creation