Database connection moved into the main class