adapt templates to workspaces
fix bugs