Cleanup selectors, make element logic more robust