removed dead code
removed logging
refactoring