separate publish function from documentation