documentation
factor auxiliary functions from core