Added javadoc
Refactored + javadoc