Tidy up mathematics sub-package and others