Minor refactorings to the Java and Scala code
Merge pull request #105 from smarthi/suneel1

Minor refactorings to the Java code