Index: src/ControlStruct/MultiLevelExit.cpp
===================================================================
--- src/ControlStruct/MultiLevelExit.cpp	(revision efcd8f2323aace651ef5f31a13022319827bb26d)
+++ src/ControlStruct/MultiLevelExit.cpp	(revision 0577df2ebf16c54042e9bf74bca99c6a5bcb4b19)
@@ -149,6 +149,5 @@
 };
 
-NullStmt * labelledNullStmt(
-	const CodeLocation & cl, const Label & label ) {
+NullStmt * labelledNullStmt( const CodeLocation & cl, const Label & label ) {
 	return new NullStmt( cl, vector<Label>{ label } );
 }
@@ -164,5 +163,5 @@
 
 const CompoundStmt * MultiLevelExitCore::previsit(
-	const CompoundStmt * stmt ) {
+		const CompoundStmt * stmt ) {
 	visit_children = false;
 
@@ -189,6 +188,5 @@
 }
 
-size_t getUnusedIndex(
-	const Stmt * stmt, const Label & originalTarget ) {
+size_t getUnusedIndex( const Stmt * stmt, const Label & originalTarget ) {
 	const size_t size = stmt->labels.size();
 
@@ -210,6 +208,5 @@
 }
 
-const Stmt * addUnused(
-	const Stmt * stmt, const Label & originalTarget ) {
+const Stmt * addUnused( const Stmt * stmt, const Label & originalTarget ) {
 	size_t i = getUnusedIndex( stmt, originalTarget );
 	if ( i == stmt->labels.size() ) {
@@ -356,6 +353,5 @@
 
 // Mimic what the built-in push_front would do anyways. It is O(n).
-void push_front(
-	vector<ptr<Stmt>> & vec, const Stmt * element ) {
+void push_front( vector<ptr<Stmt>> & vec, const Stmt * element ) {
 	vec.emplace_back( nullptr );
 	for ( size_t i = vec.size() - 1 ; 0 < i ; --i ) {
@@ -590,19 +586,15 @@
 
 		ptr<Stmt> else_stmt = nullptr;
-		Stmt * loop_kid = nullptr;
+		const Stmt * loop_kid = nullptr;
 		// check if loop node and if so add else clause if it exists
-		const WhileDoStmt * whilePtr = dynamic_cast<const WhileDoStmt *>(kid.get());
-		if ( whilePtr && whilePtr->else_) {
+		const WhileDoStmt * whilePtr = kid.as<WhileDoStmt>();
+		if ( whilePtr && whilePtr->else_ ) {
 			else_stmt = whilePtr->else_;
-			WhileDoStmt * mutate_ptr = mutate(whilePtr);
-			mutate_ptr->else_ = nullptr;
-			loop_kid = mutate_ptr;
-		}
-		const ForStmt * forPtr = dynamic_cast<const ForStmt *>(kid.get());
-		if ( forPtr && forPtr->else_) {
+			loop_kid = mutate_field( whilePtr, &WhileDoStmt::else_, nullptr );
+		}
+		const ForStmt * forPtr = kid.as<ForStmt>();
+		if ( forPtr && forPtr->else_ ) {
 			else_stmt = forPtr->else_;
-			ForStmt * mutate_ptr = mutate(forPtr);
-			mutate_ptr->else_ = nullptr;
-			loop_kid = mutate_ptr;
+			loop_kid = mutate_field( forPtr, &ForStmt::else_, nullptr );
 		}
 
