Refactor torrent object specific code