refactoring for new version of grisu