preupdate: code cleanup