Several refactors.
Merge pull request #880 from ESwordTheCat/ubn2DxAa

Several refactors.