refactor visibility, update javadoc