Mock repository tests code cleaned up