Renamed a few variables, extracted remaining tasks as TODO