upgrade registerStyle and registerScript functions