add null guard
add comment on how to inject SPI implementation