Cosmetic refactoring and JavaDocs filling