Refactor deploy. Refactor IP selection.
Add debug option