doclist: code cleanup and preparation