add isStringCompilableUnit
refactor code