Extract some model table logic