Writing well split methods in ruby