Fix: remove temporary directory after upload to server.
Refactor: a bit cleaner method for databags.