mavenizing and refactoring to be used in other projects