refactoring for pseudo
temp