Writting a little bit idiomatic Ruby code