Refactoring to resolve cyclic deps