cleanup bitwise stuff