refactor pushing elements to document field