whouldn't it be more efficient to include this validation in the upper if?