made usable as standalone or lib