minor refactoring and adding comment on line-numbers being left-padded or right-aligned