Refactoring math out of util
Refactoring math out of util