implemented repository functions