remove finish functions
turn elementary bit functions into inline functions