diff --git a/app/helpers/mattermost_helper.rb b/app/helpers/mattermost_helper.rb
new file mode 100644
index 0000000000000000000000000000000000000000..49ac12db832827dc1e4561be3691298aee0b2754
--- /dev/null
+++ b/app/helpers/mattermost_helper.rb
@@ -0,0 +1,9 @@
+module MattermostHelper
+  def mattermost_teams_options(teams)
+    teams_options = teams.map do |id, options|
+      [options['display_name'] || options['name'], id]
+    end
+
+    teams_options.compact.unshift(['Select team...', '0'])
+  end
+end
diff --git a/copy.sh b/copy.sh
deleted file mode 100755
index 2cdc593ef6d154dda3c891074b3c56bedb835f79..0000000000000000000000000000000000000000
--- a/copy.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-set -xe
-
-# rsync --delete -av config/{routes.rb,routes,initializers,application.rb} zj-gitlab:/opt/gitlab/embedded/service/gitlab-rails/config/
-rsync --delete -av lib/mattermost zj-gitlab:/opt/gitlab/embedded/service/gitlab-rails/lib
-# rsync --delete -av vendor/{assets,gitignore,gitlab-ci-yml} zj-gitlab:/opt/gitlab/embedded/service/gitlab-rails/vendor/
-# rsync --delete -av ../gitlab-shell/{bin,lib,spec,hooks} zj-gitlab:/opt/gitlab/embedded/service/gitlab-shell
-#ssh gitlab-test 'cd /opt/gitlab/embedded/service/gitlab-rails && /opt/gitlab/embedded/bin/bundle install --deployment'
-#ssh gitlab-test 'export NO_PRIVILEGE_DROP=true; export USE_DB=false; gitlab-rake assets:precompile'
-ssh zj-gitlab gitlab-ctl restart
diff --git a/lib/mattermost/client.rb b/lib/mattermost/client.rb
index fa3c9fa27bdc9f24b101ac23d8a48e9d64cb5054..ec2903b7ec6c1daf7bdeea3320155da2c8149c81 100644
--- a/lib/mattermost/client.rb
+++ b/lib/mattermost/client.rb
@@ -30,12 +30,12 @@ module Mattermost
       json_response = JSON.parse(response.body)
 
       unless response.success?
-        raise ClientError(json_response['message'] || 'Undefined error')
+        raise Mattermost::ClientError.new(json_response['message'] || 'Undefined error')
       end
 
       json_response
     rescue JSON::JSONError
-      raise ClientError('Cannot parse response')
+      raise Mattermost::ClientError.new('Cannot parse response')
     end
   end
 end
diff --git a/lib/mattermost/session.rb b/lib/mattermost/session.rb
index 8fcd4a84af5a2bb38dbb89d7f1c04821dfe98c05..ddfeb88a71f74a3aa792465540a54837ba93cb84 100644
--- a/lib/mattermost/session.rb
+++ b/lib/mattermost/session.rb
@@ -81,9 +81,9 @@ module Mattermost
     def post(path, options = {})
       self.class.post(path, options.merge(headers: @headers))
     rescue HTTParty::Error => e
-      raise ConnectionError(e.message)
+      raise Mattermost::ConnectionError.new(e.message)
     rescue Errno::ECONNREFUSED
-      raise ConnectionError
+      raise Mattermost::ConnectionError.new(e.message)
     end
 
     private
diff --git a/spec/lib/mattermost/team_spec.rb b/spec/lib/mattermost/team_spec.rb
index ef39c456d5f0eb00689a76ca5d6269b26cd873bd..704579f0f48ab44e0566f6044e471b9f006f192b 100644
--- a/spec/lib/mattermost/team_spec.rb
+++ b/spec/lib/mattermost/team_spec.rb
@@ -3,9 +3,6 @@ require 'spec_helper'
 describe Mattermost::Team do
   describe '#all' do
     let(:user) { build(:user) }
-
-    subject { described_class.new(user) }
-
     let(:response) do
       [{
         "id" => "xiyro8huptfhdndadpz8r3wnbo",
@@ -22,6 +19,7 @@ describe Mattermost::Team do
         "allow_open_invite" => false }]
     end
 
+    subject { described_class.new(user) }
 
     before do
       allow(subject).to receive(:json_get).and_return(response)