Moved part of the "call function" logic to runtime