Cleaned up documentation and legacy code