Minor refactor to simplify the code a little; Boil down determineHandler.