refactor awk