add simple references support
improve reference support