doc update
Code cleanup:  refactoring, dead code.