Repository pattern

Repository pattern is added.