added checks for provided formatter class
extracted check into separate method
added exception messages