Refactor error constants and messages for util module