switch if/else ordering for readability