Reorganized and better documented collection tip code