optimize selector api