change the check for folders
remove needless function
normalize the output stream
minor changes to the config