tw refactori