add several internal functions