Add null checks and acceptAll method