Cleanup of unused and difficult to maintain code.