Refactored repository client and several models.