changes according to the yzen PR, functions refactoring