         return FieldValueFactorFunctionBuilder()
     }
     
-    public static func linearDecayFunction(_ builderClosure: (LinearDecayFunctionBuilder) -> Void) -> LinearDecayFunctionBuilder {
-        return LinearDecayFunctionBuilder(builderClosure: builderClosure)
-    }
-    
-    public static func gaussDecayFunction(_ builderClosure: (GaussDecayFunctionBuilder) -> Void) -> GaussDecayFunctionBuilder {
-        return GaussDecayFunctionBuilder(builderClosure: builderClosure)
-    }
-    
-    public static func exponentialDecayFunction(_ builderClosure: (ExponentialDecayFunctionBuilder) -> Void) -> ExponentialDecayFunctionBuilder {
-        return ExponentialDecayFunctionBuilder(builderClosure: builderClosure)
-    }
-    
-    public static func scriptFunction(_ builderClosure: (ScriptScoreFunctionBuilder) -> Void) -> ScriptScoreFunctionBuilder {
-        return ScriptScoreFunctionBuilder(builderClosure: builderClosure)
-    }
-    
-    public static func randomFunction(_ builderClosure: (RandomScoreFunctionBuilder) -> Void) -> RandomScoreFunctionBuilder {
-        return RandomScoreFunctionBuilder(builderClosure: builderClosure)
-    }
-    
-    public static func weightFactorFunction(_ builderClosure: (WeightBuilder) -> Void) -> WeightBuilder {
-        return WeightBuilder(builderClosure: builderClosure)
-    }
-    
-    public static func fieldValueFactorFunction(_ builderClosure: (FieldValueFactorFunctionBuilder) -> Void) -> FieldValueFactorFunctionBuilder {
-        return FieldValueFactorFunctionBuilder(builderClosure: builderClosure)
-    }
-}
-
+}
+
+// MARK:- ScoreFunctionBuilder Protocol
 
 public protocol ScoreFunctionBuilder {
     

    }
    
    public enum Modifier: String {
        case NONE = "none"
        case LOG = "log"
        case LOG1P = "log1p"
        case LOG2P = "log2p"
        case LN = "ln"
        case LN1P = "ln1p"
        case LN2P = "ln2p"
        case SQUARE = "square"
        case SQRT = "sqrt"
        case RECIPROCAL = "reciprocal"
    }
}

//public class Script {

    private static let MODIFIER = "modifier"
    private static let MISSING = "missing"
    
    public let name: String = "field_value_factor"
    
    public let field: String
    public let factor: Decimal
    public let modifier: Modifier?
    public let missing: Decimal?
    
    public init(field: String, factor: Decimal, modifier: FieldValueScoreFunction.Modifier? = nil, missing: Decimal? = nil) {
        self.field = field
        self.factor = factor
        self.modifier = modifier
        self.missing = missing
    }
    
    internal convenience init(withBuilder builder: FieldValueFactorFunctionBuilder) throws {
        
        guard builder.field != nil else {
            throw ScoreFunctionBuilderError.missingRequiredField("field")
        }
        
        guard builder.factor != nil else {
            throw ScoreFunctionBuilderError.missingRequiredField("factor")
        }
        
        self.init(field: builder.field!, factor: builder.factor!, modifier: builder.modifier, missing: builder.missing)
    }
    
    public func toDic() -> [String : Any] {
