Simplified and removed code that was added too prematurely.