initial draft for raintime refactoring