refactor from ez_new and ez__construct