Refactor initialize