TH-8 | Refactor codes