Add arena preparation frames and some refactoring
Remove some unused code
Various changes, fixes and additions