NPC optimization