Moving math functions to a separated module