formatting and some file/folder existence checks