Modify code to ruby like.