view source added comment and a little refactaring.