moved creation of collection to separate function

Signed-off-by: Blessing Osakue <iyoworks@gmail.com>