add plugin ui elements and cleanup