tighten up cleanup and element targeting