refact container hook