added fixes and refactorings to do

added fixes and todos refactorings