Miscellaneous changes

Miscellaneous changes, only some code refactoring  and change the enforcer rule to allow maven 3.1.1, all tests pass