pwn refactoring