clean up javascript handling of core selector.