lot of refectoring, might not be stable, use v0.1 if there are problems