Code organization and JavaDocs update