Improved exception message
Refactoring repos and queries