another useful function that might fit nice in a mixin at a later date