Optimize the registration pass