Refectoring

Implemented repository