split in setup and publish function