Simplified code a little.