added generic factory to util