move setup function up