Made the code a little bit more idiomatic.