add some types and move node code out