using FunctionBuilder instead of Functino
refactoring, adding serializable