submeta refactor

...and a couple bug fixes along the way