remove whitespaces and unused variable

Removed whitespaces and an unused variable named `key`.