[WIP] Fix/codeclimate findings

fix some code climate warnings