some more moving around for structural clarity