Simplified some matches to let statements.