New Hamiltonian formalisms for cavity quantum electrodynamics