Maven fixes and refactoring