refactor initialization