refactor url and link handler API