Some refactorings and initial collection implementation