write loader and initializer