refining repository operations and tests