added demo
extracted populate method