refactor webmention code