working lazyreferences; need to clean the code;