compress and deploy
carefully switching to roots
more refactoring