repository functions