rewrite AppKernel