further refactoring the tests for the esm API