implementation for group & connect with database