Optimize get_instance() calls/assignments