Refactor RepositoryPlugin