Make Some Code More Idiomatic