more cleanup for mathjs code