Slightly cleaned up code.