Fixing pom and refactring