Remove cyclomatic complexity reported by rubocop