refactor emitter/schema, use utils