Implement optimizing box and position with scripting language.