Cleaned up revision code