Refactor, add empty value test