Add comments and extract interfaces.

paint package is also messed ...