refactored and removed code from nbrno, to make it warehouse