got publish to work and refactored state client