Moved init code