refactoring on javascritp core translations. add Math support