refactor, cleanup, some docs
correct CRLF to LF