some work for reactive code
updated version