refactoring for new core version