Updated library to use new collections API