refactor to Option pattern