handle extra spaces + new lines + tabs