moves initialization to initialize function