constructor implementation