removed autopublish and addes publish/subscribe mechanism