finished the most of reporitory impl