Changing constructor to a factory instead