Added ability to work with V1 and V2 runtimes