Close #13
Refactor and simplifying for #13
Prepare #14