Refactoring to improve code climate score.

[ci skip]