added some workarounds so that it build without compat/legacy API