rearchitected some stuff