code clean-up
merge sub-functions into render()

in order to make InterWiki linkid resolved correctly.
Merge pull request #1 from ssahara/interwiki-fix

It's a practical solution. Thank you for your contribution !