fixed an issue introduced during the last refactoring and added some JavaDoc comments