Refactoring and javadocs
Javadocs
More reformatting