moved some stuff to script