cep script improvements with callback functions