added spaces to ' and '
refactored and added logs