refactor to return better values