refactoring and test for resource environment loader with JAXB