Minor refactoring to demote BDB-JE - specific parts