fixed dependency cycle
added documentation