Refactor public constructor