refactor initialize