add gemnasium and codeclimate badges
extract method; test exception