adjusted to work with the new structure of mysql DB and redis.