Made code a bit more elegant.