Some code adjustments for codeclimate