reworked constructor implementation