issue #2789: Removes unused empty lines and renames some variables.