default value issue
refactor function that gets value with default