A lot of refactoring to get second tune to work
Fix parser