More documentation and cleanup