Added documentation and updated tests to work with refactor