api changes and optimization