refatoring.  implemented a base constructor.