move some parts to native js