Make rubocop happier, change 'and' to '&&' and use do blocks instead of { ... }