The code is now a bit tidier thanks to tips from Freenode/#ruby.