changed the architecture a bit