converting to a more active record style