Clean up / speed up setting of scaling functions