fixes subCollection
code clean-up