document helper function