refactor null checking for people table view