Applied decorator pattern to separate public API null checking from real
implementation.