REFACTOR optimised allowed patterns to set tenant for the request, and better error handling
REFACTOR improved messages for logger & some minor fixes
FIX not catching IndexOutOfBoundsException for flow control