Extract some methods related with repository