optimize registration