moved init code