improve initialize method