Cleaning up collections code