Added jsDoc comments to factories.js