Refactor the compiler support and write test.