move the backend detection outside of static block