Refactor + RainTPL mostly done