Adding code for handling multiple backends