cleanup spaces and unused variables