applied module pattern to dgraph