changing database connection from singleton to connection pool and some packages refactor also