generalize a bit