Why not defining a function in the factory closure instead of on the class, that would reference the correct implementation ? the check would be done once. Same for _cancelRendering.