Refactor for Photon and global constants, even less difficult