change model to use active record