Improve readability of status handling code