format & add more javadoc