Refactor collection to be able use it in context.