Restructuring + UserAgent support + queue support