A few improvements

I spent about half an hour and came up with a few improvements. The tests still pass so hopefully didn't break anything.