Some refactorings and support surface as paint.