need to refactor