Refactoring, close #25