externalize script for better update experience