get rid of external dependencies and consolidate templates