Add JavaDoc & refactoring