Started conversion to typescript