changed collections to javascript objects