moved publish request in a separate class