small refactoring: density code, eliminate unnecessary variable assignment