cleanup setup code a bit