refactor codes for hints-ext