handle class or id selection, cleanup