Creating the necessary directories.