add more tests for esformatter.rc and simplify implementation