Removed trailing whitespace and unused code