Simplify newInstance() code