Introduced new getBits and setBits methods to filter class to simplify
the previous loop used to visit the bits.

Change-Id: I8f138e6c806027a9f62e2d8be1391e7222ab9f69