Refactored Keystone setup as a step toward integrating Keystone correction with stereo