Add proper mode extraction