minor tweaking in pattern
update plugins
default to empty (don't check for null)
change complex if to switch
minor code improvements