replace all code new SQLite3(...) by Factory::database()