Converted to maven, refactored