put more logic in one place: model
use c++ style