refactor to expose some util methods