move view functions to view
works properly and displays collection in console