Refactor to get scaling working

@jstenhouse How about this? :smile: