A little refactoring and  Bit Position Exercise