Simplify attach

I was working on a bigger refactor a few weeks ago, but let's just merge this for now.