Cleanup and add file downloading