refactored initialize