added loggin
refactoring