Cleaned code accordingly to codeclimate