Tweaked infobox API, cleaned up code