Improved activity detection