some refactoring of bdls