Refactoring of the compiler code that translates scope directives