WSOTWO-87: Code clean up and add javadoc