referctoring
add not null case