removed repetitive code

started using codeclimate.com - its awesome!