Simplify a bit logic