The null check has been done at upper level, so we don't need it here. I will improve the overall  logic shortly by using enum.
So i don't address this at this time.