cleanup
add extern register