refactor a model method
add more test and coverage