re-work internals a bit