resolved cyclic dependencies, refactoring