Refactoring
Modify deprecated func