Refactored the repositories

- Added specs
- Removed some unused methods
- Clean code