introduced bmutil package and refactored the code around it