use functional combinator style
fix bug to remove \r \n space