reworking active record