Refactoring, less awk, more utils