refactoring(moved code around packages), polishing and JavaDoc