Newline in error
Some refactoring