The code below expects the result to be a symbol or nil, I did not want my code to have any side effects.