Refactored helpers to resolve circular dependency issues.