Refactored dinodex based on Franco's comments

Put this logic into it's own method, like `parse_input_file`. Then this method would be cleaned up a bit more