Documentation for several internal functions