Updated pom.xml and done code refactoring