Refactor AppModel IsValid and stringHelper