Refactor and add tests for plugins.py

Improvement to the tests currently being run on ``plugins.py``
This would be better as a FIXME comment. Also refer to any related issues on GH if they exist.