Semi refactor