small refactorings and implement enhancement #8

enhancement #8