Make functions more portable