updated to work with repos and EF