make registerInstance's second argument optional