Documentation and some cleaning