refactor args loop for cleaner handling of blank entries