replace the set of if statement with jump table to remove pylint warning