Simplify the code a bit.