Add setup function and move config