implemented repository specific stream wrappers, several refactorings