Separated attach() from execute() (fixes #18)