implement more repository method, split gy_repository.c and gy.h from gy.c