refactor nil in get method