promise refactoring + differentiate
some cleaning