Moved repo logic to its own class