Replaced ugly logands with marginally less ugly extract_bits

Test Plan: asdfasdfasdfadfadsf