optimize selector library