JUDDI-1006 fixed, along with some light refactoring
2 files changed