Refactors scale: function() and bounds: function()