refactor awk script into separate file