refactor to fix