Refactor patched method in order to not copy/paste core code