Somewhat cleaner code.