pass name of plugin in error function
generalize error function
remove blank line
code cleanup