need refactor