Improve initialize logic