Minor cleanup, use json_decode on template