Fixed pom files and refactored some classes