Remove duplicate code
remove trailing space
convert to unix style