minor refractoring plus trying to for intialisation to work again