Updated documentation and code cleanup