format and add registered routine