init code moved from testing