Improve repositories scalability + unit tests