some refactoring: synchronizedorinized code comments with issues on github
also some code deletions