semi-large-ish refactor of built-in pkgs