moved node template logic to preprocess function