remove unused variable and newlines