I could have fixed the function to work as expected, but I don't really see the result as 'more readable' anyway...