Tidied up the js filtering by consistently using scopes.