Over time, my philosophy on "riding to the right" has evolved. I used to hug the curb, and was pretty stressed by it. I now allow myself no less than 18" from the curb, and up to 3' if there are too many hazards and the lane is wide enough. Cars deal with me as they need to, but I either take the lane or move over, no in between.
Sure, I could ride through most of the hazards, but in the event that I need to dodge a well placed alternator or exahaust system, I prefer to snap to the right, where I know there are no 3000lbs cars.
I also started taking the lane (far left) at lights. This works for both cars and me, as it allows right turns on red for them, and no right hooks for me on green.