Simplify doubles logic