Clean up, document code