Abstracted functions to class.Update to main_function required.
Added support for a proxy.