redo flags to not have pointers everywhere, require passing of url