Fixing pom files and refactoring