rewrite of deep populate functiionality