Restoring to pre-dynamic state

Cleanups and code migration