refactor flow-init to parent level. store source element's scope on file