Some basic tidying up

Just a few basic refactors here to move the code to more idio(ma)tic Ruby.
More requests to come...