diff --git a/app/contexts/commit_load_context.rb b/app/contexts/commit_load_context.rb
index a14291b9b0d1a94b7453e634543290dfef05ea16..1f23f633af322e528211a3b14b71b49c9fd1aa20 100644
--- a/app/contexts/commit_load_context.rb
+++ b/app/contexts/commit_load_context.rb
@@ -13,12 +13,12 @@ class CommitLoadContext < BaseContext
 
     if commit
       commit = CommitDecorator.decorate(commit)
-      line_notes = project.commit_line_notes(commit)
+      line_notes = project.notes.for_commit_id(commit.id).inline
 
       result[:commit] = commit
       result[:note] = project.build_commit_note(commit)
       result[:line_notes] = line_notes
-      result[:notes_count] = line_notes.count + project.commit_notes(commit).count
+      result[:notes_count] = project.notes.for_commit_id(commit.id).count
 
       begin
         result[:suppress_diff] = true if commit.diffs.size > Commit::DIFF_SAFE_SIZE && !params[:force_show_diff]
diff --git a/app/contexts/notes/load_context.rb b/app/contexts/notes/load_context.rb
index 907c7c7ade286f10486e2351c4421fa62ab883b2..a8f617a782b3fbcc0df42cd4010be0b5b384e127 100644
--- a/app/contexts/notes/load_context.rb
+++ b/app/contexts/notes/load_context.rb
@@ -9,7 +9,7 @@ module Notes
 
       @notes = case target_type
                when "commit"
-                 project.commit_notes(project.repository.commit(target_id)).fresh.limit(20)
+                 project.notes.for_commit_id(target_id).not_inline.fresh.limit(20)
                when "issue"
                  project.issues.find(target_id).notes.inc_author.fresh.limit(20)
                when "merge_request"
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 7e64c0f6e8268bad7960c35d7381824edb155e9b..17d41f27f34853addb36d6ef6a3884ff60e911f8 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -149,10 +149,6 @@ class Commit
     prev_commit.try :id
   end
 
-  def parents_count
-    parents && parents.count || 0
-  end
-
   # Shows the diff between the commit's parent and the commit.
   #
   # Cuts out the header and stats from #to_patch and returns only the diff.
diff --git a/app/models/note.rb b/app/models/note.rb
index abd89a8a46ec1aa365c2a2afc1d91f242a3c4a9f..b055ae623b20b2a372e00977c8f5533ed9ef4f34 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -42,11 +42,11 @@ class Note < ActiveRecord::Base
   mount_uploader :attachment, AttachmentUploader
 
   # Scopes
-  scope :for_commits, ->{ where(noteable_type: "Commit") }
+  scope :for_commit_id, ->(commit_id) { where(noteable_type: "Commit", commit_id: commit_id) }
+  scope :inline, where("line_code IS NOT NULL")
+  scope :not_inline, where("line_code IS NULL")
+
   scope :common, ->{ where(noteable_type: ["", nil]) }
-  scope :today, ->{ where("created_at >= :date", date: Date.today) }
-  scope :last_week, ->{ where("created_at  >= :date", date: (Date.today - 7.days)) }
-  scope :since, ->(day) { where("created_at  >= :date", date: (day)) }
   scope :fresh, ->{ order("created_at ASC, id ASC") }
   scope :inc_author_project, ->{ includes(:project, :author) }
   scope :inc_author, ->{ includes(:author) }
diff --git a/app/models/project.rb b/app/models/project.rb
index 2204d4a56e58092c11cef5716d6ec74e912c4e9f..702f4b2bf815ec92203129d878d2992f28d3bf89 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -83,10 +83,6 @@ class Project < ActiveRecord::Base
   scope :joined, ->(user) { where("namespace_id != ?", user.namespace_id) }
 
   class << self
-    def authorized_for user
-      raise "DERECATED"
-    end
-
     def active
       joins(:issues, :notes, :merge_requests).order("issues.created_at, notes.created_at, merge_requests.created_at DESC")
     end
@@ -215,14 +211,6 @@ class Project < ActiveRecord::Base
     notes.new(commit_id: commit.id, noteable_type: "Commit")
   end
 
-  def commit_notes(commit)
-    notes.where(commit_id: commit.id, noteable_type: "Commit", line_code: nil)
-  end
-
-  def commit_line_notes(commit)
-    notes.where(commit_id: commit.id, noteable_type: "Commit").where("line_code IS NOT NULL")
-  end
-
   def last_activity
     last_event
   end
diff --git a/app/models/user.rb b/app/models/user.rb
index 5e4815da865dc667469ab148d9c3a4b6e7d80d2b..341b96a0d913df57daabeaa73a93871218bf7599 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -230,10 +230,6 @@ class User < ActiveRecord::Base
     abilities.allowed?(self, action, subject)
   end
 
-  def last_activity_project
-    projects.first
-  end
-
   def first_name
     name.split.first unless name.blank?
   end
diff --git a/app/models/users_project.rb b/app/models/users_project.rb
index 362b1a5d8e5aca2d6d25cb3236d687e295aef576..79146289836cfd5bfd70b8721917b6c572fe0490 100644
--- a/app/models/users_project.rb
+++ b/app/models/users_project.rb
@@ -106,28 +106,6 @@ class UsersProject < ActiveRecord::Base
       truncate_teams [project.id]
     end
 
-    def bulk_delete(project, user_ids)
-      UsersProject.transaction do
-        UsersProject.where(user_id: user_ids, project_id: project.id).each do |users_project|
-          users_project.skip_git = true
-          users_project.destroy
-        end
-
-        project.update_repository
-      end
-    end
-
-    def bulk_update(project, user_ids, project_access)
-      UsersProject.transaction do
-        UsersProject.where(user_id: user_ids, project_id: project.id).each do |users_project|
-          users_project.project_access = project_access
-          users_project.skip_git = true
-          users_project.save
-        end
-        project.update_repository
-      end
-    end
-
     def roles_hash
       {
         guest: GUEST,
@@ -147,10 +125,6 @@ class UsersProject < ActiveRecord::Base
     end
   end
 
-  def role_access
-    project_access
-  end
-
   def update_repository
     gitolite.update_repository(project)
   end
diff --git a/app/models/wiki.rb b/app/models/wiki.rb
index 252a97e8cca647dda190cec95f3a9bbe8129181e..4f113957f990b8dbe875959418eea1f1295b5766 100644
--- a/app/models/wiki.rb
+++ b/app/models/wiki.rb
@@ -50,5 +50,4 @@ class Wiki < ActiveRecord::Base
   def set_slug
     self.slug = self.title.parameterize
   end
-
 end
diff --git a/app/views/commits/_commit.html.haml b/app/views/commits/_commit.html.haml
index 156ff1e9d85cf4a32635c3d3542d789342a3a0d1..eb0312d01e1fc74822da0e041f181c5ad62482db 100644
--- a/app/views/commits/_commit.html.haml
+++ b/app/views/commits/_commit.html.haml
@@ -14,8 +14,8 @@
       &nbsp;
 
     %span.notes_count
-      - notes = @project.commit_notes(commit) + @project.commit_line_notes(commit)
+      - notes = @project.notes.for_commit_id(commit.id)
       - if notes.any?
-        %span.btn.small.disabled.grouped
+        %span.btn.disabled.grouped
           %i.icon-comment
           = notes.count
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index 8e06e6748da849856a7312567dd631ab4a0f2c43..62e83b31b7f864fb0cd9b8d8b8747e7a832d0740 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -34,12 +34,6 @@ describe Note do
     it { should validate_presence_of(:project) }
   end
 
-  describe "Scopes" do
-    it "should have a today named scope that returns ..." do
-      Note.today.where_values.should == ["created_at >= '#{Date.today}'"]
-    end
-  end
-
   describe "Voting score" do
     let(:project) { create(:project) }