Separate checkIsReference function