-- working code and tests for plugin retrieve