refactor remove extra function