ENH: added common funtions.