better if logic in view