ajusts to the new JStack format and some refactoring