Refactored code and added code climate badge