A better way to write common behaviour for Ruby methods.