First pass at bnp refactoring