repository function