Add JavaDocs: Issue #2. Minor refactoring.