Reorganized code and remove unuseful code, and did some optimizations for http request and achieving easier cookies