refactoring related to ez_new() etc