put logic in model where it belonged