implement runtime context
refactor rain
sync rain with server.