removed logs and provided small refactoring