Get rid of get_context_instance function
Specified scope for variable 'plugin'