move avgScale to core