issue #4277 : Refactor codes to support compile.

issue #4277 : Refactor codes to support compile.