refactor to create newInstance() method