remove newline character
refactor