Remove empty lines and unused local variables