Refactored segmentation into helper class
Removed ant build.xml
Added command line interface