I don't understand why this is not in the general switch case block, that would make the code more structured and without the ugly returns in the middle