refactor to avoid  soup