refactoring
add extension for returning null and default