Moved logic from view to model. Maybe helps clear up things?