Simplified logic in pom.xml, rectified code according to feedback