api improvement and pattern analysis improved