diff --git a/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ChangeUpdatedListener.java b/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ChangeUpdatedListener.java
index 95b5cb8..6a71881 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ChangeUpdatedListener.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ChangeUpdatedListener.java
@@ -21,6 +21,7 @@
 import com.google.gerrit.reviewdb.server.ReviewDb;
 import com.google.gerrit.server.CurrentUser;
 import com.google.gerrit.server.IdentifiedUser;
+import com.google.gerrit.server.config.PluginConfig;
 import com.google.gerrit.server.config.PluginConfigFactory;
 import com.google.gerrit.server.events.Event;
 import com.google.gerrit.server.events.EventListener;
@@ -61,15 +62,15 @@
 
   @Inject
   ChangeUpdatedListener(
-      final ReviewersByBlame.Factory reviewersByBlameFactory,
-      final GitRepositoryManager repoManager,
-      final WorkQueue workQueue,
-      final IdentifiedUser.GenericFactory identifiedUserFactory,
-      final ThreadLocalRequestContext tl,
-      final SchemaFactory<ReviewDb> schemaFactory,
-      final PluginConfigFactory cfg,
-      final ChangeData.Factory changeDataFactory,
-      final @PluginName String pluginName) {
+      ReviewersByBlame.Factory reviewersByBlameFactory,
+      GitRepositoryManager repoManager,
+      WorkQueue workQueue,
+      IdentifiedUser.GenericFactory identifiedUserFactory,
+      ThreadLocalRequestContext tl,
+      SchemaFactory<ReviewDb> schemaFactory,
+      PluginConfigFactory cfg,
+      ChangeData.Factory changeDataFactory,
+      @PluginName String pluginName) {
     this.reviewersByBlameFactory = reviewersByBlameFactory;
     this.repoManager = repoManager;
     this.workQueue = workQueue;
@@ -93,15 +94,10 @@
     String ignoreSubjectRegEx;
     String ignoreFileRegEx;
     try {
-      maxReviewers =
-          cfg.getFromProjectConfigWithInheritance(projectName, pluginName)
-              .getInt("maxReviewers", 3);
-      ignoreSubjectRegEx =
-          cfg.getFromProjectConfigWithInheritance(projectName, pluginName)
-              .getString("ignoreSubjectRegEx", "");
-      ignoreFileRegEx =
-          cfg.getFromProjectConfigWithInheritance(projectName, pluginName)
-              .getString("ignoreFileRegEx", "");
+      PluginConfig projectConfig = cfg.getFromProjectConfigWithInheritance(projectName, pluginName);
+      maxReviewers = projectConfig.getInt("maxReviewers", 3);
+      ignoreSubjectRegEx = projectConfig.getString("ignoreSubjectRegEx", "");
+      ignoreFileRegEx = projectConfig.getString("ignoreFileRegEx", "");
     } catch (NoSuchProjectException x) {
       log.error(x.getMessage(), x);
       return;
@@ -114,7 +110,7 @@
         RevWalk rw = new RevWalk(git);
         ReviewDb reviewDb = schemaFactory.open()) {
       Change.Id changeId = new Change.Id(e.change.get().number);
-      final ChangeData cd = changeDataFactory.create(reviewDb, projectName, changeId);
+      ChangeData cd = changeDataFactory.create(reviewDb, projectName, changeId);
       if (cd == null) {
         log.warn(
             "Change with id: '{}' on project key: '{}' not found.",
@@ -122,7 +118,7 @@
             projectName.toString());
         return;
       }
-      final Change change = cd.change();
+      Change change = cd.change();
       PatchSet.Id psId = new PatchSet.Id(changeId, e.patchSet.get().number);
       PatchSet ps = cd.patchSet(psId);
       if (ps == null) {
@@ -130,13 +126,13 @@
         return;
       }
 
-      final RevCommit commit = rw.parseCommit(ObjectId.fromString(e.patchSet.get().revision));
+      RevCommit commit = rw.parseCommit(ObjectId.fromString(e.patchSet.get().revision));
 
       if (!ignoreSubjectRegEx.isEmpty() && commit.getShortMessage().matches(ignoreSubjectRegEx)) {
         return;
       }
 
-      final Runnable task =
+      Runnable task =
           reviewersByBlameFactory.create(commit, change, ps, maxReviewers, git, ignoreFileRegEx);
 
       workQueue
diff --git a/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ReviewersByBlame.java b/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ReviewersByBlame.java
index 7b3b31d..8ca04cb 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ReviewersByBlame.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ReviewersByBlame.java
@@ -81,16 +81,16 @@
 
   @Inject
   public ReviewersByBlame(
-      final Emails emails,
-      final AccountCache accountCache,
-      final PatchListCache patchListCache,
+      Emails emails,
+      AccountCache accountCache,
+      PatchListCache patchListCache,
       GerritApi gApi,
-      @Assisted final RevCommit commit,
-      @Assisted final Change change,
-      @Assisted final PatchSet ps,
-      @Assisted final int maxReviewers,
-      @Assisted final Repository repo,
-      @Assisted final String ignoreFileRegEx) {
+      @Assisted RevCommit commit,
+      @Assisted Change change,
+      @Assisted PatchSet ps,
+      @Assisted int maxReviewers,
+      @Assisted Repository repo,
+      @Assisted String ignoreFileRegEx) {
     this.emails = emails;
     this.accountCache = accountCache;
     this.patchListCache = patchListCache;
@@ -160,7 +160,7 @@
    * @param reviewers A set of reviewers with their weight mapped to their {@link Account}
    * @return Reviewers that are best matches for this change, empty if none, never <code>null</code>
    */
-  private Set<Account.Id> findTopReviewers(final Map<Account, Integer> reviewers) {
+  private Set<Account.Id> findTopReviewers(Map<Account, Integer> reviewers) {
     Set<Account.Id> topReviewers = Sets.newHashSet();
     List<Entry<Account, Integer>> entries =
         Ordering.from(
@@ -185,8 +185,7 @@
    * @param blameResult Result of blame computation
    * @return a set of all possible reviewers, empty if none, never <code>null</code>
    */
-  private Map<Account, Integer> getReviewersForPatch(
-      final List<Edit> edits, final BlameResult blameResult) {
+  private Map<Account, Integer> getReviewersForPatch(List<Edit> edits, BlameResult blameResult) {
     Map<Account, Integer> reviewers = Maps.newHashMap();
     for (Edit edit : edits) {
       for (int i = edit.getBeginA(); i < edit.getEndA(); i++) {
@@ -220,7 +219,7 @@
    * @param parent Parent {@link RevCommit}
    * @return Result of blame computation, null if the computation fails
    */
-  private BlameResult computeBlame(final PatchListEntry entry, final RevCommit parent) {
+  private BlameResult computeBlame(PatchListEntry entry, RevCommit parent) {
     BlameCommand blameCommand = new BlameCommand(repo);
     blameCommand.setStartCommit(parent);
     blameCommand.setFilePath(entry.getNewName());
