close #14; refactorization