constructor refactor & add unit-test

#7 add over again unit-test