move some stuff around for clarity