some functional subfunctions