refactoring into reusable pieces, export more funcs
release 0.2.0