Update for better script performance