refactoring and added find_by_id for torrents