unimath4 refactoring