Move the code to create or overwrite node table columns to a function