Documentation and cleaning up