Improve attach command
Add lots of small changes