refactor to return entire object instead of value