Rework FlashPolicyHandler for better performance