refactoring model. use rails3 recommend method.