Refactor and simplify code
Release 0.4.0