refactor

non-functional changes from reading through the v3 code... pretty much just for readability