swarm: split functions, create SwarmUtils
swarm, utils, upload_handler: fix function calls