Some code renaming and JavaDocs adjusted.