refactorize some complex methods
add code climate badge
Merge pull request #72 from jrdi/refactorize_complex_methods