make it workable as a standard dll
make api less stateful