refactor for initialize