plugin cleanup & minor edits