huge refactor.

    schema metaprogram