introduce Plans and some bugfixes