Tidied up cb-app detection