Use switch args in top-level api for perf
[TMP] Build lib