remove unused StringBuilder
update implementation to use BigDecimal
* Note: the class Function still use java.math.Math