Improoved version of REPLCompletion.