The role of environment on quenching, star formation and AGN activity