Improve performance and add first API