Moved to helpers in order to not duplicate the functionality in multiple places. It's supposedly private in its original location, so the refactoring shouldn't cause issues.