Code cleanup (thanks @MathewLenning)