DDF-462 added javadoc and reformatted code