javadocs and code cleanup