extract function to convert status register value to a return result, improving code readability