improved readability, removed useless code
remove logging