add registration code and tool