Adjust code to rubocop guidelines