Code and documentation cleanup