constructor refactor & add unit-test