refactor codes