ENH: more linear registration work and code cleanup