Refactored: math classes