move some logic to PhotonBeam class