cleaned up memory interfaces a lot, removed some hackish stuff