improved refacor and Javadoc