Refactor fixup.rs