extract newInstance method