further work on callback hells, optimizations