Refactoring for newest version