Move database updates and some common functions to a first file to load