moving some potentially common functions out