cleanup line ending conversion code