start refactoring
close #8