use constructor factory pattern