cleaning up semantic analyzer for refactoring