Refactor. Remove dependency cycle