Refactored to static functions