refactor intialize