documentation, refactoring to make the dependency chain easier to follow