added / migrated javadocs, cleaned up some code