Refactoring functions update