There is some duplication, apparently to handle top/width instead of left/height. Can we use parameters instead?