init code and db